package org.grow.took.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.grow.took.entity.Player;
import org.grow.took.entity.PlayerQueryCondition;

import java.util.List;

@Mapper//将PlayerDao放入容器中进行管理
//extends BaseMapper,使得增删改都会继承到
public interface PlayerDao extends BaseMapper<Player> {
    List<Player> findByName(@Param("name") String username);
    //升级分页不需要改动PlayerMapper.xml文件
    //List<Player> dynamicQuery(@Param("qc") PlayerQueryCondition queryCondition);
    IPage<Player> dynamicQuery(IPage<Player> iPage, @Param("qc") PlayerQueryCondition queryCondition);
    int updateGoldCoinByCode(@Param("code") String code,
                             @Param("gold") Integer goldCoin,
                             @Param("version") Integer lastVersion);
    Player findByCode(@Param("code") String code);
}
